const state = {
  main: 0,
  state0: 0,
  state1: 1,
  changeState: 10,
  stateObj: {
    obj: {
      val: 10
    }
  },
}

const getters = {
  countState1(state){
    return state.state1;
  },
  countStateObj(state){
    return state.stateObj;
  }
}

const mutations = {
  DECREMENT_MAIN_COUNTER (state) {
    state.main--
  },
  INCREMENT_MAIN_COUNTER (state) {
    state.main++
  },
  state0Watch(state){
    state.state0++
  }
}

const actions = {
  someAsyncTask ({ commit }) {
    // do something async
    commit('INCREMENT_MAIN_COUNTER')
  },
  state0WatchAsyncTask ({ commit }) {
    // do something async
    commit('state0Watch')
  }
}

export default {
  state,
  getters,
  mutations,
  actions
}
